/**
 * @Author: aesoper
 * @Description:
 * @File:  dig
 * @Version: 1.0.0
 * @Date: 2020/6/28 1:49
 */

package inject

import "go.uber.org/dig"

var container = dig.New()

func MustProvide(constructor interface{}, opts ...dig.ProvideOption) error {
	return container.Provide(constructor, opts...)
}

func MustInvoke(function interface{}, opts ...dig.InvokeOption) error {
	return container.Invoke(function, opts...)
}

// 取得原始错误信息
func RootCause(err error) error {
	return dig.RootCause(err)
}
